@extends('admin._layout.default')

@section('content')
    <div class="row">
        <div class="col-md-12">
            <form method="get" action="" class="form-inline" target="_self">
                <div class="form-group input-group-sm f-g">
                    <label for="search-username">用户名</label>
                    <input type="text" value="{{$data['username'] or ''}}" name="username" id="search-username" class="form-control">
                </div>

                <div class="form-group input-group-sm f-g">
                    <label for="search-realname">真实姓名</label>
                    <input type="text" value="{{$data['realname'] or ''}}" name="realname" id="search-realname" class="form-control">
                </div>

                <div class="form-group input-group-sm f-g">
                    <label for="search-time">操作时间</label>
                    <input type="text" value="{{$data['timeFrom'] or ''}}" name="time_from" id="search-time" class="form-control">
                    到
                    <input type="text" value="{{$data['timeTo'] or ''}}" name="time_to" id="search-time-to" class="form-control">
                </div>

                <div class="form-group btn-group-sm f-g">
                    <input class="btn btn-primary" type="submit" value="查询日志">
                </div>
            </form>
        </div>
        <div style="margin-bottom:5px; clear:both;"></div>
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="table-responsive">
                    <table class="table table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>用户名</th>
                            <th>真实姓名</th>
                            <th>操作详情</th>
                            <th>操作IP</th>
                            <th>操作时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach($list as $key => $value): ?>
                        <tr>
                            <td>{{$value['id']}}</td>
                            <td>{{$value['username']}}</td>
                            <td>{{$value['realname']}}<?php echo $value['realname']; ?></td>
                            <td>
                                {{$value['content']}}
                            </td>
                            <td>
                                {{$value['ip']}}
                            </td>
                            <td>
                                {{date('Y-m-d H:i:s', $value['add_time'])}}
                            </td>
                        </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <?php echo $page; ?>
@endsection
@section('footer_script')
    <link rel="stylesheet" type="text/css" href="<?php echo loadStatic('/lib/datepicker/bootstrap-datetimepicker.min.css'); ?>">
    <script src="<?php echo loadStatic('/lib/datepicker/bootstrap-datetimepicker.min.js'); ?>" type="text/javascript"></script>
    <script src="<?php echo loadStatic('/lib/datepicker/locales/bootstrap-datetimepicker.zh-CN.js'); ?>" type="text/javascript"></script>
    <script type="text/javascript">
        $('#search-time').datetimepicker({
            language:  'zh-CN',
            format: "yyyy-mm-dd hh:ii:ss",
            weekStart: 1,
            todayBtn:  1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0
        });

        $('#search-time-to').datetimepicker({
            language:  'zh-CN',
            format: "yyyy-mm-dd hh:ii:ss",
            weekStart: 1,
            todayBtn:  1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0
        });
    </script>
@endsection